<template>
    <view class="goods_item">
        <view class="title">
            <text class="titletext">{{noticebyid.noticeTitle}}</text>
        </view>
        <view>
            <text class="time">{{ noticebyid.time }}</text>
        </view>
        <view class="content">
			<text>{{content}}</text>
        </view>
    </view>
</template>

<script>
const app = getApp();
var urlPrefix = app.globalData.urlPrefix;
export default {
    data() {
        return {
            noticebyid: null,
            content: null,
            imgs: null,
			token:null
        };
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
		var token = uni.getStorageSync('token');
		this.token = token
        let that = this;
        //公告
        uni.request({
            url: urlPrefix + '/api/applet/index/noticeById?id=' + options.id,
            method: 'GET',
            header: {
                'content-type': 'application/json',
                'token': this.token
            },
            success: function (res) {
                let dataList = res.data;
                that.setData({
                    noticebyid: dataList.datas,
                    content: dataList.datas.noticeContent
                });
            }
        });
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {uni.stopPullDownRefresh();},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {},
    onShareTimeline(res) {
        // 分享到朋友圈
        return {};
    },
    methods: {}
};
</script>
<style lang="scss">
@import './noticetext.scss';
</style>
